#pragma once

#include <memory>
#include <string>
#include "classfile/member_info.h"
#include "rtda/heap/access_flags.h"

namespace jvm {
namespace heap {

class Class;

class ClassMember {
protected:
    uint16_t m_accessFlags;
    std::string m_name;
    std::string m_descriptor;
    std::shared_ptr<Class> m_pClass;

public:
    ClassMember() = default;
    void copyMemberInfo(const std::shared_ptr<classfile::MemberInfo> pMemberInfo);
    
    // Access flags
    bool isPublic() const;
    bool isPrivate() const;
    bool isProtected() const;
    bool isStatic() const;
    bool isFinal() const;
    bool isSynthetic() const;
    
    // Getters
    const std::string& getName() const;
    const std::string& getDescriptor() const;
    std::shared_ptr<Class> getClass() const;
    
    // Access control
    bool isAccessibleTo(std::shared_ptr<Class> pD) const;
};

} // namespace heap
} // namespace jvm
